using Ocelot.DependencyInjection;
using Ocelot.Middleware;
using Ocelot.Provider.Consul;

namespace OcelotAndConsul
{
    public class Program
    {
        public static void Main(string[] args)
        {

            var builder = WebApplication.CreateBuilder(args);
            builder.Services.AddOcelot().AddConsul();
            builder.Host.ConfigureAppConfiguration(config => { config.AddJsonFile("ocelotConfig.json", false, true); });

           
            var app = builder.Build();
            app.Urls.Add("http://127.0.0.1:5086");
            app.MapControllers();
            app.UseOcelot().Wait();
            app.Run();


        }
    }
}